<?
	if($_POST['cpass'] == "1"){
		$valuearray['u_user'] =  $_POST['user'];
		$valuearray['u_pass'] =  $_POST['pass1'];
		Qupdate("useradmin",'',$valuearray," u_id= ".$_POST['u_id']);
	}
/*	*/
?>

<SCRIPT LANGUAGE="JavaScript">
function fdgre()
{
	if( document.getElementById("user").value == "" || document.getElementById("pass1").value == "" || document.getElementById("pass2").value == ""  )
	{
		alert("Error ! Username or password is blank");
		return false;
	}
	else if( document.getElementById("pass1").value   !=  document.getElementById("pass2").value   )
	{
		alert("Error ! Password is Fail");
		return false;
	}
	else 
	{
		alert("Your password is successful updated ");
		return true;
	}
}
</SCRIPT>
<?
$r = Q2("select * from useradmin where u_user = '".$_SESSION['admin_user']."' ");
//echo "select * from useradmin where u_user = '".$_SESSION['admin_user']."' ";
?>
<p>
<FORM METHOD=POST ACTION="" onsubmit="javascript:return fdgre();";>
<label>Username</label>
<INPUT TYPE="text" NAME="user" value="<?=$r[0]['u_user']?>" >


<BR><BR>
<label>Password</label>
<INPUT TYPE="password" NAME="pass1"  value="<?=$r[0]['u_pass']?>">

<BR><BR>
<label>Password again</label>
<INPUT TYPE="password" NAME="pass2" value="<?=$r[0]['u_pass']?>">

<BR><BR>
<INPUT TYPE="hidden"  name = "cpass" value="1">
<INPUT TYPE="hidden"  name = "u_id" value="<?=$r[0]['u_id']?>" />
<INPUT TYPE="submit" value="save">
</FORM>
</p>

<div style="clear:both;"></div>